package com.zeek.car90s.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

import android.util.Log;

public class TxtReader {
    static String ss[]=new String[200];
    static char[] chars;
    /**
     * 通过一个InputStream获取内容
     *
     * @param inputStream
     * @return
     */
    public static String[] getString(InputStream inputStream) {
        InputStreamReader inputStreamReader = null;
        try {
            inputStreamReader = new InputStreamReader(inputStream, "gbk");
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(inputStreamReader);
        StringBuffer sb = new StringBuffer("");
        String line;
        try {
            while ((line = reader.readLine()) != null) {
                sb.append(line);
                sb.append("\n");
                chars=line.toCharArray();
                Log.d("ZHENGWEI", String.valueOf(chars[1]));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        for(int i=0;i<chars.length;i++){
            ss[i]=String.valueOf(chars[i]);
        }
        System.out.println("zhengwei"+ss.length);
        return ss;
    }
}